package com.eddie.juc.base;

import lombok.Builder;
import lombok.Data;
import lombok.experimental.Accessors;

public class ThreadBaseDemo {
    public static void main(String[] args) {
        Thread t1 = new Thread(() -> {
        }, "t1");
        t1.start();
        Object o = new Object();
        new Thread(() -> {
            //此时的o就是管程
            synchronized (o) {

            }
        }, "t2");
        Student eddie = new Student().setAge(321).setName("Eddie");
    }
}

@Data
@Accessors(chain = true)
class Student {
    private String name;
    private Integer age;
}